package cn.shop.admin.entity.backAgentModule;

import cn.hutool.core.lang.RegexPool;
import cn.shop.base.BaseEntity;
import cn.shop.validation.Save;
import cn.shop.validation.Update;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

/**
 * 代理商信息表(BackAgent)表实体类
 *
 * @author jzw
 * @since 2021-11-03 15:11:58
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BackAgent extends BaseEntity {


	private static final long serialVersionUID = -8371917412088405557L;

	/**
	 * 姓名
	 */
	@NotBlank(message = "姓名不能为空", groups = {Save.class, Update.class})
	@Length(max = 10, groups = {Save.class, Update.class})
	private String name;

	/**
	 * 手机号
	 */
	@Pattern(regexp = RegexPool.MOBILE, message = "请输入正确手机格式", groups = {Save.class, Update.class})
	private String phone;

	/**
	 * 微信号
	 */
	private String weChartNum;

	/**
	 * 代理级别
	 */
	@NotBlank(message = "选择代理级别", groups = Save.class)
	private String level;

	/**
	 * 佣金比例
	 */
	@NotBlank(message = "选择佣金比例", groups = Save.class)
	private String commissionRate;

	/**
	 * 审核状态
	 */
	private Integer state;

	/**
	 * 成为分销商时间
	 */
	private LocalDateTime passingTime;

	/**
	 * 上级代理商id
	 */
	private Long parentId;

}

